const Layout = () => import('~/layout/index.vue')
// 固定路由（默认路由）
let constantRoutes = [{
		path: '/login',
		name: 'login',
		component: () => import('~/views/login.vue'),
		meta: {
			title: '登录'
		}
	},
	{
		path: '/:all(.*)*',
		name: 'notFound',
		component: () => import('~/views/404.vue'),
		meta: {
			title: '找不到页面'
		}
	}
]

//动态路由 (需要权限的路由)
let asyncRoutes = [{
		path: '/',
		redirect: '/index',
		component: Layout,
		meta: {
			title: '工作台',
			icon: 'home-outlined',
			breadcrumb: false
		}, 
		children: [{
			path: 'index',
			name: 'index',
			component: () => import('~/views/index.vue'),
			meta: {
				title: '数据中心',
				sidebar: false
			}
		}]
	}, {
		path: '/setting',
		component: Layout,
		meta: {
			title: '设置中心',
			icon: 'setting-outlined',
			breadcrumb: false
		},
		children: [{
			path: 'permission',
			name: 'permission',
			component: () => import('~/views/setting/permission.vue'),
			meta: {
				title: '权限设置',
				auth: 'admin'
			}
		},{
			path: 'user',
			name: 'user',
			component: () => import('~/views/setting/user.vue'),
			meta: {
				title: '用户管理',
				auth: 'admin'
			}
		}]
	}
	// ,{
	// 		path: '/',
	// 		redirect: '/index',
	// 		component: Layout,
	// 		meta: {
	// 			title: '文章发布',
	// 			icon: 'mdi:microsoft-dynamics-365',
	// 			breadcrumb:false
	// 		}, 
	// 		children: [{
	// 			path: '/index',
	// 			name: 'index',
	// 			component: () => import('~/views/index.vue'),
	// 			meta: {
	// 				title: '文章发布',
	// 				sidebar:false
	// 			}
	// 		}]
	// 	}
]

export {
	constantRoutes,
	asyncRoutes
}